feat(downloader): add SpotiFLAC as a download source#194
Open
pacholoamit wants to merge 3 commits into
Open
Conversation
Add a 'spotiflac' download service that fetches lossless FLAC via the SpotiFLAC python module (deezer/tidal/qobuz/amazon, in priority order), mirroring the existing youtube_music subprocess pattern. Tracks are resolved by ISRC with a title/artist search fallback; downloads run synchronously and degrade gracefully so other DOWNLOAD_SERVICES take over when a track can't be sourced. - src/downloader/spotiflac.go: Downloader implementation (no queue monitoring) - src/downloader/spotiflac/spotiflac_dl.py: bundled wrapper around the module - src/config/config.go: SPOTIFLAC_* options + DownloadConfig wiring - src/downloader/downloader.go: register service in factory + needsDownloadDir - Dockerfile: pip install SpotiFLAC + bundle the wrapper script - sample.env, src/web/sample.env, README: document the new source
…dule version - spotiflac_dl.py: use download_track_async (SpotiFLAC >=1.2.1), falling back to download_track (<=1.2.0) - Dockerfile: install the module via a SPOTIFLAC_VERSION build arg (default 1.2.1), pulled from the project's matching GitHub version-branch archive since 1.2.1 restored the upstream endpoint registry and is not on PyPI yet - sample.env / src/web/sample.env: document the >=1.2.1 requirement and the build arg Verified end-to-end: a real FLAC downloads via Deezer through the Go downloader.
…1.2.3 Migrate the spotiflac source to SpotiFLAC 1.2.3, installed from PyPI (which ships the `spotiflac` CLI alongside the importable module). The downloader now serves all Explo flows via two paths: - Tracks with a streaming URL (Spotify-imported playlists) download through the official `spotiflac` CLI, matching the exact track. The Spotify import path now captures each track's URL (partner API `uri`) and threads it through the import -> cache -> run pipeline onto models.Track.SourceURL. - Tracks matched only by metadata (ISRC or title/artist, e.g. ListenBrainz discovery) download through the bundled module helper (spotiflac_dl.py), which searches each FLAC provider by ISRC with a title/artist text-search fallback, mirroring how the youtube service shells out to ytmusicapi. Either path tries the configured sources in priority order; tracks SpotiFLAC cannot source fall through to the other DOWNLOAD_SERVICES. - Dockerfile installs SpotiFLAC from PyPI and bundles the helper. - Config: SPOTIFLAC_BIN (CLI), SPOTIFLAC_PYTHON_PATH/SPOTIFLAC_SCRIPT_PATH (helper), plus SPOTIFLAC_SOURCES/QUALITY/TIMEOUT/RETRIES.
|
Awesome work, just confirming that it works for me too. Pretty sweet stuff since using it with a VPN basically removes all rate-limiting 😄 |
Author
|
Yeah, please test it out, although the stability is dependant on the SpotifyFlacModule project.. There are times it's unstable but does get fixed pretty quickly by the maintainer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
spotiflacdownload service for pulling tracks as lossless FLAC.Depending on what info Explo has for a track, it uses one of two paths:
spotiflacCLI.Both try the configured providers in order (deezer, tidal, qobuz, amazon). Anything that can't be found is skipped, so the other services in
DOWNLOAD_SERVICESstill get a turn.To capture the URL for the first path, the Spotify import now reads each track's link from the partner API and carries it through to the downloader.
Config is documented in
sample.env:SPOTIFLAC_SOURCES,SPOTIFLAC_QUALITY,SPOTIFLAC_BIN,SPOTIFLAC_PYTHON_PATH,SPOTIFLAC_SCRIPT_PATH,SPOTIFLAC_TIMEOUT,SPOTIFLAC_RETRIES. The docker image installs SpotiFLAC from PyPI (which gives both the CLI and the importable module) and copies in the helper script.Tested locally with mpd: downloaded FLACs through both paths and checked they decode cleanly with ffmpeg.
Tested with Spotify Playlist imported via Explo
I'm into very obscure music and I KNOW I'M GONNA HATE FOR THIS BUT I LIKE SOME OF THE AI MUSIC especially RnB and spotify's algorithm prioritizing AI artists is getting to me so I want FLAC files. Most of the FLACs I get are from Deezer
Example logs from Explo when pulling the FLAC file from SpotiFLAC
Refs #117